
<!-- target:edit -->
<form class="flex-cont grey-bg vertical-arrangement" name="editLoanBillForm" ui="type:m-panel">
    <input class="ui-hide" name="invoiceType" value="3"/>

    <div class="blank-24"></div>

    <div class="edit-item" ui="type:mao.ui.InputGroup;label:事由;required:true">
        <div ui="type:Text;" class="edit-text">
            <input type="text" name="reasons" value="${detail.reasons}" placeholder="请输入" value="" />
        </div>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:借款金额;required:true">
        <div ui="type:number;id:borrow-amount-${num};ext-calculate-cost:${num};" class="edit-text">
            <input type="text" name="borrowAmount" value="${detail.borrowAmount}" placeholder="请输入" value="" />
        </div>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:所属公司;required:true">
        <!-- var:affiliateCompanyId = ${detail.affiliateCompanyId} || ${mao.staffInfo.venueList.0.id} -->
        <div class="edit-input placeholder" ui="type:mao.ui.SelectEdit;title:所属公司;items:&{mao.info.baseInfo.subjectList};name:affiliateCompanyId;value:${affiliateCompanyId};text:${affiliateCompanyId|parseBaseInfo('subjectList')};"></div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:借款人;required:true">
        <!-- var:applyPersonId = ${detail.applyPersonId} || ${mao.staffInfo.staffId} -->
        <!-- var:applyPersonName = ${detail.applyPersonName} || ${mao.staffInfo.staffName} -->
        <div class="edit-input placeholder" ui="type:mao.ui.ChooseDeptStaff;id:accountUnit2;title:借款人;name:applyPersonId;value:${applyPersonId};text:${applyPersonName};"></div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:所属部门;required:true">
        <!-- var:affiliateDepartmentId = ${detail.affiliateDepartmentId} || ${mao.staffInfo.deptList.0.deptId} -->
        <!-- var:affiliateDepartmentName = mao.util.findDept(${affiliateDepartmentId}, ${affiliateDepartmentId}).name -->
        <div class="edit-input placeholder" ui="type:mao.ui.ChooseDeptStaff;isDept;title:所属部门;name:affiliateDepartmentId;value:${affiliateDepartmentId};text:${affiliateDepartmentName};"></div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:预计归还日期;required:true">

        <div class="edit-input" ui="type:m-calendar;name:prePaymentTime;value:${detail.prePaymentTime|dateFormat('yyyy-MM-dd')};placeholder:请选择预计归还日期;regexp:.+">
            <div ui="values:2000-2040;format:{0}年"></div>
            <div ui="values:1-12;format:{0}月"></div>
            <div ui="values:1-31;format:{0}日"></div>
        </div>
        <span class="edit-icon"></span>
    </div>
    <div class="edit-item" ui="type:mao.ui.InputGroup;label:备注;">
        <div ui="type:Text;" class="edit-text">
            <input type="text" name="remark" value="${detail.remark}" placeholder="请输入" value="" />
        </div>
    </div>

    <div class="edit-item button-select apply-button-select link-style" ui="type:mao.ui.InputGroup;label:申请单;">
        <!-- var:applicationInvoice = ${detail.applicationInvoice} || {} -->
        <div class="edit-input placeholder" button-text="关联申请单" ui="type:mao.ui.SelectEdit;ext-clear;title:申请单;view:bill.applySelect;sView:bill.applySelectFormItem;name:applicationInvoiceId;value:${detail.applicationInvoice.id};data:&{applicationInvoice};"></div>
        <span class="edit-icon"></span>
    </div>

    <div class="edit-item button-select apply-button-select" ui="type:mao.ui.InputGroup;label:收款账户;required:true">
        <!-- var:accountInfo = ${detail.accountInfo} || {} -->
        <div class="edit-input placeholder" button-text="选择收款账户" ui="type:NS.AccountSelectEdit;accountUnit:accountUnit2;title:收款账户;view:bill.accountSingleSelect;sView:bill.accountSingleSelectItem;name:accountId;value:${detail.accountInfo.accountId};data:&{accountInfo}"></div>
        <span class="edit-icon"></span>
    </div>

    <div class="edit-item button-select apply-button-select link-style" ui="type:mao.ui.InputGroup;label:关联项目;">
        <!-- var:project = ${detail.project} || {} -->
        <div class="edit-input placeholder" button-text="关联项目" ui="type:mao.ui.SelectEdit;ext-clear;title:关联项目;view:bill.brandProjectSelect;sView:bill.brandProjectSelectFormItem;name:projectId;value:${detail.project.id};data:&{project};"></div>
        <span class="edit-icon"></span>
    </div>

    <!-- use:uploadFile -->
    <!-- use:approvalAndSendPeople -->

    <div class="blank-24"></div>
</form>

<div class="bottom-box flex align-center" id="calculate_total_${num}">
    <div class="flex-1">
        <!-- <div class="finance-info">企业应付：<span class="unit">￥</span><span class="num">0.00</span></div> -->
        <div class="finance-info">借款金额：<span class="unit">￥</span><span class="num borrow-total">0.00</span></div>
    </div>
    <div class="btn-box">
        <div class="ui-button ui-hide" ui="type:NS.SaveBillBtn;invoiceType:3;">暂存</div>
        <div class="ui-button ui-button-primary" ui="type:NS.SaveBillBtn;invoiceType:3;">确定</div>
    </div>
</div>
